/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.dfcapi.entity;

import javax.validation.constraints.NotNull;
import com.easy.modules.sys.entity.User;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.easy.core.persistence.DataEntity;
import com.easy.common.utils.excel.annotation.ExcelField;

/**
 * 登录日志Entity
 * @author waylen chi
 * @version 2018-01-17
 */
public class ApiLoginRec extends DataEntity<ApiLoginRec> {
	
	private static final long serialVersionUID = 1L;
	private Integer loginno;		// loginno
	private User u;		// user_id
	private String apikey;		// apikey
	private String device;		// 设备号
	private String deviceos;		// 设备操作系统
	private String froms;		// 来源:Android,IOS,WEB,WEP,WECHAT,ALIPAY
	private String data;		// json 数据
	private Date logtimestamp;		// 登录时间
	private String sign;		// 签名
	private String version;		// 版本号
	private String token;		// token
	private String ipaddr;		// ip地址
	private String bsuccess;		// 是否成功
	
	public ApiLoginRec() {
		super();
	}

	//public ApiLoginRec(String id){
	//	this.id = id;
	//}

	@NotNull(message="loginno不能为空")
	@ExcelField(title="loginno", align=2, sort=0)
	public Integer getLoginno() {
		return loginno;
	}

	public void setLoginno(Integer loginno) {
		this.loginno = loginno;
	}
	
	@ExcelField(title="user_id", fieldType=User.class, value="u.userName", align=2, sort=1)
	public User getU() {
		return u;
	}

	public void setU(User u) {
		this.u = u;
	}
	
	@ExcelField(title="apikey", align=2, sort=2)
	public String getApikey() {
		return apikey;
	}

	public void setApikey(String apikey) {
		this.apikey = apikey;
	}
	
	@ExcelField(title="设备号", align=2, sort=3)
	public String getDevice() {
		return device;
	}

	public void setDevice(String device) {
		this.device = device;
	}
	
	@ExcelField(title="设备操作系统", align=2, sort=4)
	public String getDeviceos() {
		return deviceos;
	}

	public void setDeviceos(String deviceos) {
		this.deviceos = deviceos;
	}
	
	@ExcelField(title="来源:Android,IOS,WEB,WEP,WECHAT,ALIPAY", align=2, sort=5)
	public String getFroms() {
		return froms;
	}

	public void setFroms(String froms) {
		this.froms = froms;
	}
	
	@ExcelField(title="json 数据", align=2, sort=6)
	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="登录时间", align=2, sort=7)
	public Date getLogtimestamp() {
		return logtimestamp;
	}

	public void setLogtimestamp(Date logtimestamp) {
		this.logtimestamp = logtimestamp;
	}
	
	@ExcelField(title="签名", align=2, sort=8)
	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}
	
	@ExcelField(title="版本号", align=2, sort=9)
	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}
	
	@ExcelField(title="token", align=2, sort=10)
	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}
	
	@ExcelField(title="ip地址", align=2, sort=11)
	public String getIpaddr() {
		return ipaddr;
	}

	public void setIpaddr(String ipaddr) {
		this.ipaddr = ipaddr;
	}
	
	@ExcelField(title="是否成功", align=2, sort=12)
	public String getBsuccess() {
		return bsuccess;
	}

	public void setBsuccess(String bsuccess) {
		this.bsuccess = bsuccess;
	}
	
}